component extends="CollectionValueResolverHelper" implements="com.firemoss.atonement.mapper.resolution.IValueResolver"
{
	public function resolve(source, targetProperty, mapping, mappingChain)
	{
		if ( isNull( source ) )
		{
			return javacast( "null", "" );
		}
		else if ( not mappingChain.containsKey( source ) )
		{
			var result = arrayNew(1);
			var item = "";
			var i = "";
			
			for ( i=1;i<=arrayLen(source);i++ )
			{
				item = source[i];
				arrayAppend( result, createCollectionItem( source, item, targetProperty, mapping, mappingChain ) );
			}
			
			mappingChain.set( source, result );
			
			return result;
		}
		else
		{
			return mappingChain[ source ];
		}
	}
}